#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTimer>
#include <QSettings>
#include <QSqlQuery>
#include <QSqlDatabase>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    void connect_database();
    void upload();
    void download();
    void action();

    bool downloadFile(QString , QString, int);

private:
    Ui::Widget *ui;

    QTimer tmAction;
    QTimer tmExit;
    QTimer tmFlush;
    QTimer tm_connect_database;

    QSettings *setIni;

    QSqlQuery *qrm, *qrmt;
    QSqlDatabase db_m;

    QString statusText;

    bool database_connected;
};
#endif // WIDGET_H
